package emulator.unittest.hardware.bus;

import static org.junit.Assert.assertEquals;

import org.junit.Before;
import org.junit.Test;

import emulator.hardware.bus.VideoBus;

public class VideoBusTest {

	@Before
	public void setUp() throws Exception {
	}

	@Test
	public void testConvertAddressLow() {
		assertEquals(0x8000, VideoBus.convertAddress(0x0000));
		assertEquals(0x8001, VideoBus.convertAddress(0x0001));
		assertEquals(0x9FFF, VideoBus.convertAddress(0x1FFF));
	}

	@Test
	public void testConvertAddressHigh() {
		assertEquals(0x0000, VideoBus.convertAddress(0x2000));
		assertEquals(0x0001, VideoBus.convertAddress(0x2001));
		assertEquals(0x1FFF, VideoBus.convertAddress(0x3FFF));
	}

	@Test
	public void testConvertAddressLow2() {
		assertEquals(0x8000, VideoBus.convertAddress(0x4000));
		assertEquals(0x8001, VideoBus.convertAddress(0x4001));
		assertEquals(0x9FFF, VideoBus.convertAddress(0x5FFF));
	}

}
